<template>
  <li class="goods-list">
    <div class="articleList">
      <router-link
        :to="{ path: '/articleDetail', query: { id: id } }"
        class="goods-list-link"
      >
        {{ articleTitle }} - {{ articleTimeShow }}
      </router-link>
    </div>
  </li>
</template>

<script>
export default {
  props: ['id', 'articleTitle', 'articleTime'],
  data() {
    return {
      articleTimeShow: ''
    }
  },
  created() {
    this.articleTimeShow = new Date(parseInt(this.articleTime))
      .toLocaleString()
      .replace(/:\d{1,2}$/, '')
  }
}
</script>

<style lang="css" scoped>
.articleList {
  padding: 5px;
  border-bottom: 1px dashed #ababab;
}
</style>
